import React from 'react'

import WYDiscover from '@/pages/discover'
import WYRecommend from '@/pages/discover/c-pages/recommend'
import WYRanking from '@/pages/discover/c-pages/ranking'
import WYArtist from '@/pages/discover/c-pages/artist'
import WYDjradio from '@/pages/discover/c-pages/djradio'
import WYSongs from '@/pages/discover/c-pages/songs'
import WYAlbum from '@/pages/discover/c-pages/album'
import WYPlayer from '@/pages/player'

import WYMine from '@/pages/mine'
import WYFriend from '@/pages/friend'

import { Redirect } from 'react-router-dom'


const routes = [
  {
    path: "/",
    exact: true,
    render: () => (
      <Redirect to="/discover"/>
    )
  },
  {
    path: "/discover",
    component: WYDiscover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => (
          <Redirect to={"/discover/recommend"} />
        )
      },
      {
        path: "/discover/recommend",
        component: WYRecommend
      },
      {
        path: "/discover/ranking",
        component: WYRanking
      },
      {
        path: "/discover/djradio",
        component: WYDjradio
      },
      {
        path: "/discover/artist",
        component: WYArtist
      },
      {
        path: "/discover/songs",
        component: WYSongs
      },
      {
        path: "/discover/album",
        component: WYAlbum
      },
      {
        path: "/discover/player",
        component: WYPlayer
      }
    ]
  },
  {
    path: "/mine",
    exact: true,
    component: WYMine
  },
  {
    path: "/friend",
    component: WYFriend
  }

]

export default routes